home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
UUPC3
/
(UUPC__)
/
MACINIT.C
< prev
next >
Wrap
Text File
|
1992-02-10
|
1KB
|
53 lines
/* macinit.c
Portions Copyright ⌐ David Platt, 1992, 1991. All Rights Reserved
Worldwide.
*/
#ifdef THINK_C
# include "unixlibproto.h"
#endif THINK_C
#include "dcp.h"
#include <stdio.h>
macinit()
{
WindowPeek theWindow;
int consoleDriverRefNum;
DCtlHandle consoleDriverHandle;
/* standard initialization required by real Mac applications */
InitGraf(&thePort);
InitWindows();
InitFonts();
FlushEvents(everyEvent,0);
InitMenus(); /* init menu manager */
InitDialogs((ProcPtr) 0L); /* init dialog manager */
TEInit(); /* init text edit */
InitCursor();
MaxApplZone();
/*
That which follows, makes my skin crawl and my gorge rise. I
hate doing things like this. Ne'ertheless, it seems to be
necessary to keep the THINK C console driver from eating all
keyclicks which take place when its window is foremost. The
behavior of the driver is appropriate for I/O consoles, but
is inappropriate for output-only consoles such as the one
that UUPC uses.
*/
printf("Welcome to uupc!\n\n");
theWindow = stdout->window;
consoleDriverRefNum = theWindow->windowKind;
consoleDriverHandle = GetDCtlEntry(consoleDriverRefNum);
if (consoleDriverHandle) {
(**consoleDriverHandle).dCtlEMask &= 0xFFF7; /* turn off key-down event grab */
}
/*
Forgive me, for I have sinned.
dplatt@snulbug.mtview.ca.us
*/
}